﻿<UserControl
 x:Class="WPFExcelReport.WSINFOR"
 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
 xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
    xmlns:UserControls="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Controls"
    xmlns:Localization="clr-namespace:Localization;assembly=Localization"
 >
    <UserControl.Resources>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:String2ColorConverter  x:Key="str2color"/>
        <CollectionViewSource   x:Key="vwWASTAMM" Source="{Binding Path=SetMaster.WASTAMM}" />
        <CollectionViewSource   x:Key="vwWAFARBEN" Source="{Binding Path=SetMaster.WAFARBEN}" />
        <CollectionViewSource  x:Key="vwBSSATZ" Source="{Binding Path=SetMaster.BSSATZ}" />
        <CollectionViewSource   x:Key="vwBHSATZ" Source="{Binding Path=SetMaster.BHSATZ}" />
        <CollectionViewSource   x:Key="vwBSFARB" Source="{Binding Path=SetMaster.BSFARB}" />
        <CollectionViewSource  x:Key="vwWTGEW" Source="{Binding Path=SetMaster.WTGEW}" />
        <CollectionViewSource  x:Key="vwWASTKE" Source="{Binding Path=SetMaster.WASTKE}" />
        <CollectionViewSource  x:Key="vwBASTKE" Source="{Binding Path=SetMaster.BASTKE}" />
        <CollectionViewSource  x:Key="vwBASTGA" Source="{Binding Path=SetMaster.BASTGA}" />
        <CollectionViewSource  x:Key="vwWASTGA" Source="{Binding Path=SetMaster.WASTGA}" /> 
    </UserControl.Resources>
    <Grid   DataContext="" Width="1200" Margin="10,10,0,0" VerticalAlignment="Stretch">
        <Grid.RowDefinitions>
            <RowDefinition   Height="Auto" />
            <RowDefinition   Height="1*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition  Width="1*" />
            <ColumnDefinition Width="1*" />
        </Grid.ColumnDefinitions>
        <StackPanel >
            <DataGrid  
                                AutoGenerateColumns="False" EnableRowVirtualization="True" 
                                ItemsSource="{Binding Source={StaticResource ResourceKey=vwWASTAMM}}" 
                                HeadersVisibility="Column"  
                                CanUserReorderColumns="True" 
                                CanUserResizeRows="True" CanUserSortColumns="True" 
                                RowDetailsVisibilityMode="VisibleWhenSelected" 
                                Width="Auto" Height="Auto" 
                                EnableColumnVirtualization="True"
                                ScrollViewer.HorizontalScrollBarVisibility="Auto" 
                                ScrollViewer.VerticalScrollBarVisibility="Auto" 
                                >
                <DataGrid.Columns>
                    <DataGridTextColumn  Binding="{Binding Path=WAART}" Header="织轴品种"  Width="Auto" MinWidth="80" />
                    <DataGridTextColumn Binding="{Binding Path=WAVAR}" Header="版本"  Width="Auto" MinWidth="20"  />
                </DataGrid.Columns>
            </DataGrid>
            <StackPanel >
                <WrapPanel >
                    <TextBlock  >成品信息:</TextBlock>
                    <Label  Margin="20,0,0,0"  Background="Gray" Content="品种:" Grid.Row="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                    <TextBox Grid.Column="1" Text="{Binding Path=WAART, Mode=TwoWay, ValidatesOnExceptions=true, NotifyOnValidationError=true}" VerticalAlignment="Center" Width="Auto" MinWidth="180" CharacterCasing="Upper"/>
                    <TextBlock   Text="/" HorizontalAlignment="Left" VerticalAlignment="Center" />
                    <TextBox   Grid.Column="1" Text="{Binding Path=WAVAR, Mode=TwoWay, ValidatesOnExceptions=true, NotifyOnValidationError=true}" VerticalAlignment="Center" Width="Auto" MinWidth="40" CharacterCasing="Upper" />
                    <Label Background="Gray" Content="计划品名:" HorizontalAlignment="Left" VerticalAlignment="Center" />
                    <TextBlock  Grid.Column="1" HorizontalAlignment="Left" 
                                        Text="{Binding Path=WADART, Mode=TwoWay, Source={StaticResource ResourceKey=vwWASTAMM}}" 
                                         VerticalAlignment="Center" Width="185">
                    </TextBlock>
                    <TextBlock   Text="/" HorizontalAlignment="Left" VerticalAlignment="Center" />
                    <TextBox  Grid.Column="1" Text="{Binding Path=WADVAR, Mode=TwoWay, ValidatesOnExceptions=true, NotifyOnValidationError=true}" VerticalAlignment="Center" Width="Auto" MinWidth="40" />
                </WrapPanel>
                <WrapPanel   Margin="86,0,0,0">
                    <Label  Content="描述:" Grid.Row="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                    <TextBox  MaxLength="40" Text="{Binding Path=WABEZ, Mode=TwoWay, Converter={StaticResource ResourceKey=gb2312}}" 
                                      VerticalAlignment="Center" Width="330" MaxLines="1"  Background="#FFEBA9A9"
                                      >
                    </TextBox>
                    <Label Content="备注:" HorizontalAlignment="Left" VerticalAlignment="Center" />
                    <TextBox   MaxLength="40" Text="{Binding Path=WARBEM, Mode=TwoWay, Converter={StaticResource ResourceKey=gb2312}}" 
                                       VerticalAlignment="Center" Width="330" MaxLines="1"
                                       Background="#FFEBA9A9" />
                </WrapPanel>
                <WrapPanel  >
                    <Grid Margin="86,0,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition   Width="1*" />
                            <ColumnDefinition   Width="1*" />
                        </Grid.ColumnDefinitions>
                        <Label Content="经密:" Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                        <TextBox Grid.Column="1" Text="{Binding Path=WAFFDDIK, Mode=TwoWay, Converter={StaticResource ResourceKey=d100}}" VerticalAlignment="Center" Width="60" />
                    </Grid>
                    <Grid   Margin="0,0,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition   Width="1*" />
                            <ColumnDefinition   Width="1*" />
                        </Grid.ColumnDefinitions>
                        <Label Content="成品纬密:" Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                        <TextBox Grid.Column="1" Text="{Binding Path=WAFFDDIS, Mode=TwoWay,  Converter={StaticResource ResourceKey=d100}}" VerticalAlignment="Center" Width="60" />
                    </Grid>
                    <TextBlock >(</TextBlock>
                    <Label  Content="{Binding Path=WAFDDIM}" VerticalAlignment="Center" Width="40" Height="25" />
                    <TextBlock >)</TextBlock>
                    <Grid >
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition  Width="1*" />
                            <ColumnDefinition  Width="1*" />
                        </Grid.ColumnDefinitions>
                        <WrapPanel  Grid.Column="0">
                        </WrapPanel>
                        <WrapPanel  Grid.Column="1">
                        </WrapPanel>
                    </Grid>
                    <Grid >
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition  Width="1*" />
                            <ColumnDefinition  Width="1*" />
                        </Grid.ColumnDefinitions>
                        <WrapPanel  Grid.Column="0">
                        </WrapPanel>
                        <WrapPanel  Grid.Column="1">
                        </WrapPanel>
                    </Grid>
                    <Grid >
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition  Width="1*" />
                            <ColumnDefinition  Width="1*" />
                        </Grid.ColumnDefinitions>
                        <WrapPanel  Grid.Column="0">
                        </WrapPanel>
                        <Label  Content="幅宽:" Grid.Row="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                        <WrapPanel  Grid.Column="1">
                            <TextBox  Grid.Column="1" Text="{Binding Path=WAFBRTL, Mode=TwoWay,  Converter={StaticResource ResourceKey=d10}}" VerticalAlignment="Center" Width="Auto" MinWidth="40" />
                        </WrapPanel>
                    </Grid>
                    <Grid >
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition   Width="1*" />
                            <ColumnDefinition Width="1*" />
                        </Grid.ColumnDefinitions>
                        <WrapPanel  Grid.Column="0">
                        </WrapPanel>
                        <Label  Content="成品匹长:" Grid.Row="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                        <WrapPanel  Grid.Column="1">
                            <TextBox   Grid.Column="1" Text="{Binding Path=WAFSTDLG, Mode=TwoWay,  Converter={StaticResource ResourceKey=d1000}}" VerticalAlignment="Center" Width="Auto" MinWidth="60" />
                        </WrapPanel>
                    </Grid>
                    <Grid >
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition   Width="1*" />
                            <ColumnDefinition Width="1*" />
                        </Grid.ColumnDefinitions>
                        <WrapPanel  Grid.Column="0">
                        </WrapPanel>
                        <Label  Content="成品克重:" Grid.Row="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                        <WrapPanel  Grid.Column="1">
                            <TextBox   Grid.Column="1" Text="{Binding Path=WAFGRLFD, Mode=TwoWay}" VerticalAlignment="Center" Width="Auto" MinWidth="60" />
                            <TextBlock>g/m</TextBlock>
                        </WrapPanel>
                    </Grid>
                    <Grid >
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition  Width="1*" />
                            <ColumnDefinition  Width="1*" />
                        </Grid.ColumnDefinitions>
                        <WrapPanel  Grid.Column="0">
                        </WrapPanel>
                        <Label  Content="纬密系数:" Grid.Row="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                        <WrapPanel  Grid.Column="1">
                            <TextBox  Grid.Column="1" Text="{Binding Path=WALAEAEND, Mode=TwoWay,  Converter={StaticResource ResourceKey=d100}}" VerticalAlignment="Center" Width="Auto" MinWidth="20" />
                            <TextBlock >%</TextBlock>
                        </WrapPanel>
                    </Grid>
                </WrapPanel>
                <WrapPanel >
                    <TextBlock >坯布信息:</TextBlock>
                    <Grid  Margin="20,0,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition  Width="1*" />
                            <ColumnDefinition Width="1*" />
                        </Grid.ColumnDefinitions>
                        <Label Content="经密:" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="-2,3,0,3" />
                        <TextBox Grid.Column="1" Text="{Binding Path=WARFDDIK, Mode=TwoWay,  Converter={StaticResource ResourceKey=d100}}" VerticalAlignment="Center" Width="60" />
                    </Grid>
                    <Grid  >
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition  Width="1*" />
                            <ColumnDefinition  Width="1*" />
                        </Grid.ColumnDefinitions>
                        <Label  Content="下机纬密:" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                        <TextBox   Grid.Column="1" Text="{Binding Path=WARFDDIS, Mode=TwoWay,  Converter={StaticResource ResourceKey=d100}}" VerticalAlignment="Center" Width="60" />
                    </Grid>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition  Width="1*" />
                            <ColumnDefinition  Width="1*" />
                        </Grid.ColumnDefinitions>
                        <WrapPanel   Grid.Column="0">
                        </WrapPanel>
                        <Label  Content="幅宽:" Grid.Row="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                        <WrapPanel   Grid.Column="1">
                            <TextBox  Grid.Column="1" Text="{Binding Path=WARWBRT, Mode=TwoWay,  Converter={StaticResource ResourceKey=d10}}" VerticalAlignment="Center" Width="Auto" MinWidth="60" />
                        </WrapPanel>
                    </Grid>
                    <Grid >
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition   Width="1*" />
                            <ColumnDefinition Width="1*" />
                        </Grid.ColumnDefinitions>
                        <WrapPanel  Grid.Column="0">
                        </WrapPanel>
                        <Label  Content="标准匹长:" Grid.Row="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                        <WrapPanel  Grid.Column="1">
                            <TextBox   Grid.Column="1" Text="{Binding Path=WARSTDLG, Mode=TwoWay,  Converter={StaticResource ResourceKey=d1000}}" VerticalAlignment="Center" Width="Auto" MinWidth="60" />
                        </WrapPanel>
                    </Grid>
                    <Grid >
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition   Width="1*" />
                            <ColumnDefinition Width="1*" />
                        </Grid.ColumnDefinitions>
                        <WrapPanel  Grid.Column="0">
                        </WrapPanel>
                        <Label  Content="坯布克重:" Grid.Row="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                        <WrapPanel  Grid.Column="1">
                            <TextBox   Grid.Column="1" Text="{Binding Path=WARGRLFD, Mode=TwoWay}" VerticalAlignment="Center" Width="Auto" MinWidth="60" />
                            <TextBlock>g/m</TextBlock>
                        </WrapPanel>
                    </Grid>
                </WrapPanel>
                <StackPanel  >
                    <WrapPanel  DataContext="{Binding Source={StaticResource ResourceKey=vwWTGEW}}">
                        <TextBlock  >工艺信息:</TextBlock>
                        <Grid   Margin="20,0,0,0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition   Width="1*" />
                                <ColumnDefinition   Width="1*" />
                            </Grid.ColumnDefinitions>
                            <Label  Content="机上纬密:" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="-3,3,0,3" />
                            <TextBox  Grid.Column="1" Text="{Binding Path=WTGFDISM, Mode=TwoWay,  Converter={StaticResource ResourceKey=d100}, Source={StaticResource ResourceKey=vwWTGEW}}" VerticalAlignment="Center" Width="60" />
                        </Grid>
                        <Grid   Margin="10,0,0,0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition   Width="1*" />
                                <ColumnDefinition   Width="1*" />
                            </Grid.ColumnDefinitions>
                            <Label  Content="引纬纱长:" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                            <TextBox   Grid.Column="1" Text="{Binding Path=WTGFDLGS, Mode=TwoWay,  Converter={StaticResource ResourceKey=d10}, Source={StaticResource ResourceKey=vwWTGEW}}" VerticalAlignment="Center" Width="60" />
                        </Grid>
                        <Grid  Margin="10,0,0,0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition  Width="1*" />
                                <ColumnDefinition  Width="1*" />
                            </Grid.ColumnDefinitions>
                            <Label   Content="筘幅:" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                            <TextBox   Grid.Column="1" Text="{Binding Path=WTGWBBRT, Mode=TwoWay,  Converter={StaticResource ResourceKey=d10}, Source={StaticResource ResourceKey=vwWTGEW}}" VerticalAlignment="Center" Width="60" />
                        </Grid>
                        <TextBlock >cm</TextBlock>
                        <Grid Margin="10,0,0,0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="1*" />
                                <ColumnDefinition Width="1*" />
                            </Grid.ColumnDefinitions>
                            <Label Content="筘号:" Grid.Column="0" Grid.Row="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                            <TextBox  Grid.Column="1" Text="{Binding Path=WTGWBF, Mode=TwoWay,  Converter={StaticResource ResourceKey=d100}, Source={StaticResource ResourceKey=vwWTGEW}}" VerticalAlignment="Center" Width="60" />
                        </Grid>
                        <TextBlock Width="11">#</TextBlock>
                    </WrapPanel>
                    <WrapPanel  Margin="92,0,0,0">
                        <Grid >
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition x:Uid="ColumnDefinition_33" Width="1*" />
                                <ColumnDefinition x:Uid="ColumnDefinition_34" Width="1*" />
                            </Grid.ColumnDefinitions>
                            <Label Content="纹板图" VerticalAlignment="Center" Margin="-2,1,2,1" />
                            <TextBlock Grid.Column="1" Background="Wheat" 
                                              Width="Auto"
                                              MinWidth="100"
                                              HorizontalAlignment="Left"  
                                              Text="{Binding Path=WABIND, Mode=TwoWay, Source={StaticResource ResourceKey=vwWASTAMM}, Converter={StaticResource ResourceKey=gb2312}}" 
                                              >
                            </TextBlock>
                        </Grid>
                        <Grid >
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="1*" />
                                <ColumnDefinition Width="1*" />
                            </Grid.ColumnDefinitions>
                            <Label  Content="扦筘法:" VerticalAlignment="Center" Margin="0,1" />
                            <TextBlock  Grid.Column="1" HorizontalAlignment="Left" 
                                                Text="{Binding Path=WAEINZNR, Mode=TwoWay, Source={StaticResource ResourceKey=vwWASTAMM}}" 
                                                VerticalAlignment="Center" Width="120">
                            </TextBlock>
                        </Grid>
                        <Grid >
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition x:Uid="ColumnDefinition_37" Width="1*" />
                                <ColumnDefinition x:Uid="ColumnDefinition_38" Width="1*" />
                            </Grid.ColumnDefinitions>
                            <WrapPanel  Grid.Column="0">
                            </WrapPanel>
                            <Label  Content="纬向排花:" Grid.Row="0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                            <WrapPanel Grid.Column="1">
                                <TextBlock Background="Wheat" HorizontalAlignment="Left" 
                                               Text="{Binding Path=WTGSFLG, Source={StaticResource ResourceKey=vwWTGEW}, Mode=TwoWay}"  
                                                  Width="120">
                                </TextBlock>
                            </WrapPanel>
                        </Grid>
                    </WrapPanel>
                </StackPanel>
            </StackPanel>
            <DataGrid  AutoGenerateColumns="False" EnableRowVirtualization="True" 
                      ItemsSource="{Binding Source={StaticResource ResourceKey=vwBASTGA}}" HeadersVisibility="Column" CanUserReorderColumns="True" CanUserResizeRows="True" CanUserSortColumns="True" 
                       RowDetailsVisibilityMode="VisibleWhenSelected" Width="Auto" Height="Auto" EnableColumnVirtualization="True" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto">
                <DataGrid.Columns>
                    <DataGridTextColumn Binding="{Binding Path=BAGPOS}" Header="行" Width="Auto" MinWidth="30" />
                    <DataGridTextColumn Binding="{Binding Path=BAGGART}" Header="纱线" Width="Auto" MinWidth="120" />
                    <DataGridTextColumn Binding="{Binding Path=BAGGVAR}" Header="版本" Width="Auto" MinWidth="30" />
                    <DataGridTextColumn Binding="{Binding Path=BAGFDZ}" Header="根数" Width="Auto" MinWidth="40" />
                    <DataGridTextColumn Binding="{Binding Path=BAGABF, Converter={StaticResource ResourceKey=d10}}" Header="损耗" Width="Auto" MinWidth="40" />
                    <DataGridTextColumn Binding="{Binding Path=BAGKGNET, Converter={StaticResource ResourceKey=d1000}}" Header="净重" Width="Auto" MinWidth="60" />
                    <DataGridTextColumn Binding="{Binding Path=BAGKGBRUT, Converter={StaticResource ResourceKey=d1000}}" Header="总重" Width="Auto" MinWidth="60" />
                </DataGrid.Columns>
            </DataGrid>
            <DataGrid Grid.Column="0" AutoGenerateColumns="False" EnableRowVirtualization="True" ItemsSource="{Binding Source={StaticResource ResourceKey=vwWASTGA}}" HeadersVisibility="Column" x:Name="dlgWASTGA" CanUserReorderColumns="True" CanUserResizeRows="True" CanUserSortColumns="True" 
                      RowDetailsVisibilityMode="VisibleWhenSelected" Width="Auto" Height="Auto" EnableColumnVirtualization="True" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto">
                <DataGrid.Columns>
                    <DataGridTextColumn Binding="{Binding Path=WAGPOS}" Header="行" Width="Auto" MinWidth="40" />
                    <DataGridTextColumn Binding="{Binding Path=WAGGART}" Header="纱线" Width="Auto" MinWidth="160" />
                    <DataGridTextColumn Binding="{Binding Path=WAGGVAR}" Header="版本" Width="Auto" MinWidth="40" />
                    <DataGridTextColumn Binding="{Binding Path=WAGFDZ}" Header="根数" Width="Auto" MinWidth="40" />
                    <DataGridTextColumn Binding="{Binding Path=WAGABF,  Converter={StaticResource ResourceKey=d10}}" Header="损耗" Width="Auto" MinWidth="40" />
                    <DataGridTextColumn Binding="{Binding Path=WAGKGNET, Converter={StaticResource ResourceKey=d1000}}" Header="净重" Width="Auto" MinWidth="40" />
                    <DataGridTextColumn Binding="{Binding Path=WAGKGBRUT,  Converter={StaticResource ResourceKey=d1000}}" Header="总重" Width="Auto" MinWidth="40" />
                </DataGrid.Columns>
            </DataGrid>
        </StackPanel>
    </Grid>
</UserControl>
